package com.chenyuxin.ilp.controller.user;

import com.chenyuxin.ilp.model.pojo.Result;
import com.chenyuxin.ilp.service.user.UserStorageService;
import com.chenyuxin.ilp.util.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/storage")
public class UserStorageController {
    @Autowired
    private UserStorageService userStorageService;
    @GetMapping
    public Result getUserStorage(){
        String userId = SecurityUtil.getUserId();
        return userStorageService.getUserStorage(userId);
    }
}
